package com.example.demo.controller;

import com.example.demo.util.TestMd5Sign;
import com.example.demo.util.TestMd5UnSign;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestController {

    @PostMapping("/getjson")
    public String get(){
        return TestMd5Sign.getRequestJson();
    }

    @GetMapping("/getjsonContent")
    public String getjsonContent(){
        System.out.println("aaaaaaaaaaaaaaaaa");
        //return TestMd5Sign.getRequestJson();
        return "aaaaaaaaaaa";
    }

    @PostMapping("/unsign")
    public String unsign(@RequestBody String req) throws JsonProcessingException {
        System.out.println("req==========="+req);
        boolean checkSignFastJson = TestMd5UnSign.checkSignFastJson(req);
        boolean checkSignGson = TestMd5UnSign.checkSignGson(req);
        boolean checkSignJackson = TestMd5UnSign.checkSignJackson(req);
        return "checkSign:{Gson:"+checkSignGson+",fastJson:"+checkSignFastJson+",jackson:"+checkSignJackson+"}";
    }



}
